set(srcs "")
set(incs "./")
set(lfs "api.lf")

file(GLOB_RECURSE SOURCES ./*.c)
list(APPEND srcs ${SOURCES})

list(APPEND incs "./config")
list(APPEND incs "./io")
list(APPEND incs "./wifi")
list(APPEND incs "./web")
list(APPEND incs "./file")

set(embed_files "${build_dir}/cache.html")

idf_component_register(
    SRCS ${srcs}
    INCLUDE_DIRS ${incs}
    LDFRAGMENTS ${lfs}
    EMBED_FILES ${embed_files}
    REQUIRES driver nvs_flash sdmmc esp_adc esp_wifi lwip esp_psram esp_mm mbedtls json esp_http_server esp_timer app_update
    WHOLE_ARCHIVE
)

target_compile_options(${COMPONENT_LIB} INTERFACE  "-O0")
